<?php

declare(strict_types=1);

namespace App\CustHub\Controller;

use App\CustHub\Annotation\ApiAuth;
use App\CustHub\Annotation\VerifySignature;
use App\CustHub\Constants\RoomTaskCenterTypeConstants;
use App\CustHub\Service\ChRoomTaskCenterService;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\GetMapping;
use Hyperf\HttpServer\Annotation\PostMapping;
use Psr\Http\Message\ResponseInterface;

/**
 * 群任务中心
 */
#[Controller('ch/room/tc'),ApiAuth,VerifySignature]
class RoomTaskCenterController extends BaseController
{
    #[Inject]
    protected ChRoomTaskCenterService $service;

    /**
     * 群任务中心
     * @return ResponseInterface
     * @throws \Psr\Container\ContainerExceptionInterface
     * @throws \Psr\Container\NotFoundExceptionInterface
     */
    #[PostMapping('list')]
    public function list(): ResponseInterface
    {
        return $this->success($this->service->list($this->request->all()));
    }

    #[PostMapping('getTypeList')]
    public function getTypeList(): ResponseInterface
    {
        return $this->success(RoomTaskCenterTypeConstants::getOptions());
    }
}